<template>
  <view class="nav">
    <view class="nav1" v-for="(item, index) in articles" :key="index">
      <p>{{item.title}}</p>
	  <p v-html="item.content"></p>
    </view>
  </view>
</template>

<script setup>
import { onLoad } from '@dcloudio/uni-app'
import { ref, reactive } from 'vue'
import { Details } from '@/utils/file.js'

let id = ref()
let articles = reactive([])

onLoad((options) => {
  id.value = options.id
  qu()
})

// 获取文章详情
function qu() {
	console.log(uni.getStorageSync('token'));
  Details(id.value,uni.getStorageSync('token')).then(res => {
    console.log(res, id.value)
    // 将数据存储在响应式对象中
    articles.push(res.data.data)
    console.log(articles)
  })
}
</script>

<style>

</style>
